package casa.depesos.app.com.http.req;


import java.util.Map;

import casa.depesos.app.com.http.HttpReq;
import casa.depesos.app.com.http.ReqCallback;
import casa.depesos.app.com.http.bean.CodeLoginBean;
import casa.depesos.app.com.http.parser.CodeLoginParser;
import casa.depesos.app.com.utils.Constant;

public class CodeLoginReq implements HttpReq<CodeLoginBean> {

    String phone, code;

    public CodeLoginReq(String phone, String code) {
        this.phone = phone;
        this.code = code;
    }

    @Override
    public void req(ReqCallback callback) {//   /app/user/loginByCode
        req("/app/consumer/authenticateWithSecurityPin", new CodeLoginParser(), callback);
    }

    @Override
    public Map getBody() {
        Map map = HttpReq.super.getBody();
        map.put("mobile", phone);
        map.put("validatiCod", code);

        map.put("sampID", Constant.instanceId);
        map.put("adID", Constant.adid);
        map.put("gpsAdID", Constant.gpsAdid);
        map.put("altGPSAdID", Constant.adjustGpsAdid);

        return map;
    }
}
